function partial(fn,...args){
  let judge = (...arg)=>{
    if(fn.length === (arg.length + args.length)){
      return fn(...args,...arg)
    }
    return (...argss) => judge(...arg,...argss)
  }
  return judge
}
function partial(fn,...args){
  return (...arg)=>{
    return fn(...args,...arg)
  }
}
function add(a,b,c){
  return a+ b + c
}
let partialAdd = partial(add,1)
console.log(partialAdd(2,9));
function partial(fn, ...args) {
  return (...arg) => {
      for(let i = 0;i < args.length;i++){
        if(args[i] === '_'){
          args.splice(i,1,...arg)
        }
      }
      return fn(...args)
  }
}
function clg(a, b, c) {
  console.log(a, b, c)
}
let partialClg = partial(clg, '_', 2)
partialClg(1, 3)  // 依次打印：1, 2, 3

function panhanshu(fn,...args){
  return (...arg)=>{
    return fn(...args,...arg)
  }
}